/*
 * @Author: Troubadour 2276791354@qq.com
 * @Date: 2024-06-06 15:36:12
 * @LastEditors: Troubadour 2276791354@qq.com
 * @LastEditTime: 2024-06-06 17:11:17
 * @Version:
 * @Description:
 */

#ifndef __BOOT_USER_H__
#define __BOOT_USER_H__

/*-------------------------------------------------------------------------------------------------------------------------------------
-                                                  Include file                                                                       -
--------------------------------------------------------------------------------------------------------------------------------------*/

#include "main.h"
#include "flash_user.h"
#include "w25q32.h"

/*-------------------------------------------------------------------------------------------------------------------------------------
-                                                  External macro                                                                     -
--------------------------------------------------------------------------------------------------------------------------------------*/

#define BOOT_DATA_ADDR              (ADDR_FLASH_SECTOR_3)
#define BOOT_APP_START_ADDR         (ADDR_FLASH_SECTOR_4)
#define BOOT_FIRMWARE_ADDR          (FAL_PARTITION_OTA_DATA_ADDR)

#define BOOT_FLAG_UPDATED_APP           (1 << 0)
#define BOOT_FLAG_UPDATE_APP_REQUEST    (1 << 1)
#define BOOT_FLAG_UPDATE_APP_OK         (1 << 2)
#define BOOT_FLAG_UPDATE_APP_ERROR      (1 << 3)
/*-------------------------------------------------------------------------------------------------------------------------------------
-                                                  External enum                                                                      -
--------------------------------------------------------------------------------------------------------------------------------------*/


/*-------------------------------------------------------------------------------------------------------------------------------------
-                                                  External structure                                                                 -
--------------------------------------------------------------------------------------------------------------------------------------*/


/*-------------------------------------------------------------------------------------------------------------------------------------
-                                                  External variables                                                                 -
--------------------------------------------------------------------------------------------------------------------------------------*/


/*-------------------------------------------------------------------------------------------------------------------------------------
-                                                  External function                                                                  -
--------------------------------------------------------------------------------------------------------------------------------------*/

void Boot_JumpFlagCheck(void);
void Boot_UpdataFlagCheck(void);


#endif  /* __BOOT_USER_H__ */
